package com.shuqi.model.bean;

import com.shuqi.model.parse.ProtobufParser;

public class BookChapterOssInfo implements Cloneable {
    private String novel_id;
    private String chapter_id;
    private String text;
    private String url;
    private String time_crawled;
    private String is_manual;

    public BookChapterOssInfo(String novel_id, String chapter_id, String text, String url,
            String time_crawled, String is_manual) {
        this.novel_id = novel_id;
        this.chapter_id = chapter_id;
        this.text = text;
        this.url = url;
        this.time_crawled = time_crawled;
        this.is_manual = is_manual;
    }

    public BookChapterOssInfo() {

    }

    public String getNovel_id() {
        return novel_id;
    }

    public void setNovel_id(String novel_id) {
        this.novel_id = novel_id;
    }

    public String getChapter_id() {
        return chapter_id;
    }

    public void setChapter_id(String chapter_id) {
        this.chapter_id = chapter_id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTime_crawled() {
        return time_crawled;
    }

    public void setTime_crawled(String time_crawled) {
        this.time_crawled = time_crawled;
    }

    public String getIs_manual() {
        return is_manual;
    }

    public void setIs_manual(String is_manual) {
        this.is_manual = is_manual;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        // TODO Auto-generated method stub
        return new BookChapterOssInfo(novel_id, chapter_id, text, url, time_crawled, is_manual);
    }

    @Override
    public int hashCode() {
        // TODO Auto-generated method stub
        return chapter_id.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof BookChapterOssInfo) {
            BookChapterOssInfo oInfo = (BookChapterOssInfo) o;
            return oInfo.chapter_id.equals(chapter_id);
        }
        return false;
    }

    @Override
    public String toString() {
        return "BookChapterOssInfo [novel_id=" + novel_id + ", chapter_id=" + chapter_id
                + ", text=" + text + ", url=" + url + ", time_crawled=" + time_crawled
                + ", is_manual=" + is_manual + "]";
    }

    public static BookChapterOssInfo fromBufBase(ProtobufParser.bufBase base) {
        return new BookChapterOssInfo(base.getNOVELID(), base.getCHAPTERID(), base.getTEXT(),
                base.getURL(), base.getTIMECRAWLED(), base.getISMANUAL());
    }
}
